#include <fstream>
#include <string>
#include <iostream>
using namespace std;

ofstream out("HowMany.out");

class HowMany{
	static int objectCount;
	public:
	HowMany(){ objectCount++;}
	HowMany(const HowMany& hm){ cout << "xxx" << endl;}
	HowMany & operator=(const HowMany& hm){
		cout << "YY" << endl;
	}
	static void print(const string& msg = ""){
		if(msg.size() != 0)
			cout << msg << ": ";
			cout << "objectCount = " << objectCount << endl;
	}
	~HowMany(){
		objectCount -- ;
		print("~HowMany()");
	}
};

	
	HowMany f(HowMany x){
		x.print("x argument inside f()");
		return x;
	}

int HowMany::objectCount = 0;

int main(){
	HowMany h;
	HowMany::print("after construction of h");
	f(h);
	//HowMany h2 = f(h);
	return 0;
}
